<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
  <meta name="author" content="wangbo">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>3d旋转</title>
  <!-- 内部样式 -->
  <style>
    body{
      /* perspective: 300px; */
    }
    .box{
      /* position: relative; */
      width: 200px;
      height: 200px;
      margin: 100px auto;
      transition: all 2s;
      /* 展示3d效果 */
      transform-style: preserve-3d;
    }
    .box div{
      /* position: absolute; */
      width: 100%;
      height: 100%;
    }
    .box div:first-child{     
      background-color: red;
    }
    .box div:last-child{
      background-color:aqua;
      /* transition: all 2s; */
      transform:  rotateX(60deg);
      
    }
    /* .box div:last-child:hover{
      transform:  rotateX(45deg);
    } */
    .box:hover{
      transform:  rotateY(80deg);
    }
  </style>
</head>
<body>
  <div class="box">
    <div>div1</div>
    <div>div2</div>
  </div>
</body>
</html>